package com.mccken.designpattern.chain.china2;

import cn.hutool.json.JSONUtil;

/**
 * @program: mccken-collect
 * @description: 主任类：具体处理着
 * @author: mccken
 * @create: 2023-01-02 23:09
 **/
public class Director extends Approver {

	public Director(String name) {
		super(name);
	}
	
	@Override
	public void processRequest(PurchaseRequest request) {
		if (request.getAmount() < 50000) {
			System.out.println(JSONUtil.toJsonStr(request) + ":" + this.name+"：主任");
		} else {
			this.successor.processRequest(request); 	
		}
	}
}
